Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add path separator to @babel/register sourceRoot #11249

Merged
merged 1 commit into from Mar 18, 2020

Conversation

andrewdotn
Copy link
Contributor

Q                       A
Fixed Issues? N/A
Patch: Bug Fix? Yes
Major: Breaking Change? No
Minor: New Feature? No
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes? No
License MIT

The Source Maps R3 standard states that sourceRoot is “prepended to
the individual entries in the ‘source’ field.” If sources contains file
names, and sourceRoot is intended to refer to a directory but doesn’t end
with a trailing slash, any consumers of the source map are in for a bad
day.

In particular, with the new NODE_V8_COVERAGE feature built-in to node,
using @babel/register results in bogus coverage data, with
…/srcfoo.js coming out where …/src/foo.js was intended.

Thanks to @bcoe for writing up Source maps in Node.js, it was a big
help in tracking down what was going wrong.

References: bcoe/c8#161, #3608

@JLHwung JLHwung added area: sourcemaps PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels Mar 12, 2020
Copy link
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to merge if Chrome DevTools can work with it. But we need revisit later.

@nicolo-ribaudo nicolo-ribaudo changed the title Add path separator to @babel-register sourceRoot Add path separator to @babel/register sourceRoot Mar 18, 2020
@nicolo-ribaudo nicolo-ribaudo merged commit 6892d51 into babel:master Mar 18, 2020
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jun 18, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: sourcemaps outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants